package com.dougmccune.charts.gantt
{
	import com.dougmccune.controls.sliderClasses.SliderThumb;
	import com.dougmccune.baseClasses.SliderBase;
	import mx.controls.Button
	import mx.core.mx_internal;
	import mx.core.IFlexDisplayObject;
	
	use namespace mx_internal;

	public class GanttSliderThumb extends SliderThumb
	{
		public function GanttSliderThumb()
		{
			super();
		}
		
		override protected function measure():void
		{
			super.measure();
	
			measuredWidth = 18;
			measuredHeight = 18;
		}
		
		override public function set xPosition(value:Number):void
		{
			
			var owner:SliderBase = owner as SliderBase;
			
			if(owner.getThumbAt(0) == this) {
				this.upSkinName = "leftThumbUpSkin";
	            this.downSkinName = "leftThumbDownSkin";
	            this.disabledSkinName = "leftThumbDisabledSkin";
	            this.overSkinName = "leftThumbOverSkin";
			}
			else if(owner.getThumbAt(2) == this) {
				this.upSkinName = "rightThumbUpSkin";
	            this.downSkinName = "rightThumbDownSkin";
	            this.disabledSkinName = "rightThumbDisabledSkin";
	            this.overSkinName = "rightThumbOverSkin";
			}
			
			if(!this.getStyle("leftThumbUpSkin")) {
				this.setStyle("leftThumbUpSkin", this.getStyle("thumbUpSkin"));
				this.setStyle("rightThumbUpSkin", this.getStyle("thumbUpSkin"));
			}
			
			if(!this.getStyle("leftThumbDownSkin")) {
				this.setStyle("leftThumbDownSkin", this.getStyle("thumbDownSkin"));
				this.setStyle("rightThumbDownSkin", this.getStyle("thumbDownSkin"));
			}
			
			if(!this.getStyle("leftThumbOverSkin")) {
				this.setStyle("leftThumbOverSkin", this.getStyle("thumbOverSkin"));
				this.setStyle("rightThumbOverSkin", this.getStyle("thumbOverSkin"));
			}
			
			if(!this.getStyle("leftThumbDisabledSkin")) {
				this.setStyle("leftThumbDisabledSkin", this.getStyle("thumbDisabledSkin"));
				this.setStyle("rightThumbDisabledSkin", this.getStyle("thumbDisabledSkin"));
			}
			
			
			this.invalidateDisplayList();
			
			super.xPosition = value;
			
		}
		
		
	}
	
	
    
    
}